//file:ServerCore\PacketAnalyzer.h


#ifndef PACKETANALYZER_H
#define PACKETANALYZER_H
#include <queue>
using std::queue;


#define ANALYZER_THREAD_NUM 2
class CKPacketAnalyzer
{
public:
	CKPacketAnalyzer();
	~CKPacketAnalyzer();
	inline void PostPacket(const CKPacket& packet );
	void BeginAnalyze();
private:
	static DWORD ThreadAdapter(void* pParam);
	void Analyzer();
private:
	queue<CKPacket> m_PacketQueue;
	HANDLE m_hSemaphore;
	HANDLE m_hThreads[ANALYZER_THREAD_NUM];
};

#endif